#ifndef FACTORY_H_
#define FACTORY_H_

#include "car.h"

class CarFactory
{
public:
	virtual Car* createCar() = 0;
};

class QQCarFactory
{
public:
	Car* createCar()
	{
		return new QQCar();
	}
};

class JiliCarFactory
{
public:
	Car* createCar()
	{
		return new JiliCar();
	}
};

template <class CarType>
class StandardCarFactory : public CarFactory
{
public:
	virtual Car* createCar();
};

template <class CarType>
Car* StandardCarFactory<CarType>::createCar()
{
	return new CarType;
}

#endif // FACTORY_H_
